package com.panshi.service.impl;

import com.panshi.entity.AppUser;
import com.panshi.service.FeignAppUserClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AppUserClientFallback implements FallbackFactory {


    @Override
    public Object create(Throwable cause) {

        return new FeignAppUserClient() {
            @Override
            public AppUser queryUserInfo(Integer userId) {
                return new AppUser().setUserIntroduce("id =>" +userId +"不存在，没有匹配的AppUser对象数据");
            }
        };
    }
}
